package com.lu.pojo.oop.extend;
/**
 * 子类： 圆
 */
public class Circle extends GeometricObject {
    private double radius;
    public static void main(String[] args) {
        Circle circle1 = new Circle(10);
        Circle circle2 = new Circle(10);
        System.out.println(circle1.equals(circle2));

    }

    private double findArea(){
        return Math.PI*this.radius*this.radius;
    }

    @Override
    public boolean equals(Object o) {
        if(o instanceof Circle){
            Circle other =(Circle)o;
            return this.radius==other.radius;
        }
        return false;
    }

    @Override
    public String toString() {
        return "radius:"+this.radius;
    }

    public Circle(){
        this.radius=1.0;
    }
    public Circle(double radius) {
        this.radius = radius;
    }

    public Circle(String color, double weight, double radius) {
        super(color, weight);
        this.radius = radius;
    }

    public double getRadius() {
        return radius;
    }

    public void setRadius(double radius) {
        this.radius = radius;
    }
}
